/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.proyectoTiberio.utility;

import com.proyectoTiberio.entity.BaseEntity;
import com.proyectoTiberio.entity.EdificioEntity;
import java.util.ArrayList;

/**
 *
 * @author chema
 */
public class HtmlUtility {
    
    public static String convertirBaseHtml(BaseEntity base)
    {
        String cadenahtml="<table width=\"1150\" height=\"424\" border=\"1\">";
        EdificioEntity ed;
                
        
        for (int j =0; j< 8; j++)
        {
            cadenahtml = cadenahtml+"<tr>";
            for(int i = 0; i<9 ;i++)
            {
                ed = BaseUtility.recuperaEdificio(i,j,base);
                
                cadenahtml = cadenahtml+ "<td>";
                if(ed != null)
                {
                    cadenahtml = cadenahtml
                            +"<div onclick=\"javasricpt:mostrarInfo(this,"+ ed.getId() +","+ed.getLevel() +","+ed.getT()+");\">"+
                                "<p> ID:"+ed.getId()+" Lvl:"+ed.getLevel()+ " T:"+ed.getT()+"</p>"
                            +"</div>"
                            ;
                }
                else
                {
                    cadenahtml = cadenahtml+"&nbsp;</td>";
                }
            }
            cadenahtml = cadenahtml+"</tr>";
        }
        
        return cadenahtml;
        
        /*
     * <table width="1150" height="424" border="1">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
     */
    }

    
}
